import { useEffect, useRef } from "react"
import styles from "./index.module.less"
import { message } from "antd"
import { useNavigate } from "umi"
import { nameToAppViewResource } from "@/global"

const ChatGptPage = () => {
  const gptUrl = 'https://ai.bikexs.cn'

  const parentNode = useRef(null)
  const iframeNode = useRef(null)

  const navigate = useNavigate()

  useEffect(() => {
    message.info("GPT助手功能已暂停服务，相同功能已为您跳转至【文案助手】");
    navigate(nameToAppViewResource("AI_DOC_VIEW").path)
  }, [])

  return <>
  {/* <a href="https://ai.bikexs.cn">gpt机器人页</a> */}
  <div id={styles['parent-container']} ref={parentNode}>
    <iframe height={'90%'} id={styles['iframe-container']} src={gptUrl} frameBorder="0" allowFullScreen ref={iframeNode}></iframe>
  </div>
  </>
}

export default ChatGptPage